package design_pattern.factory_abstract;

public class YanSheng implements NWFactory {
  Man m = null;
  Bulk b = null;

  @Override
  public Man createPerson(String type) {
    try {
      m = (Man) Class.forName("factory_abstract." + type).newInstance();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return m;
  }

  @Override
  public Bulk createAnimal(String type) {
    try {
      b = (Bulk) Class.forName("factory_abstract." + type).newInstance();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return b;
  }

}
